package com.haier.uos.weather.report.service.impl;

import com.haier.uos.weather.report.client.ApiClient;
import com.haier.uos.weather.report.service.IWeatherDataService;
import com.haier.uos.weather.report.vo.Weather;
import com.haier.uos.weather.report.vo.WeatherResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class WeatherDataServiceImpl implements IWeatherDataService {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private ApiClient apiClient;
    @Override
    public Weather getDataByCityId(String cityId) {
        WeatherResponse weatherByCityId = apiClient.getWeatherByCityId(cityId);
        return weatherByCityId.getData();
    }

}
